<?php

Menu::setOption('item.active_child_class', 'active open');

$MenuManageUserLevel1 = Menu::items()->addClass('sub-menu');

foreach (trans('navigation.manage-user') as $sKey => $sName) {
    $sTempURL = CNamHoa::slugNH('navigation.manage-user-name') . '/' . CNamHoa::slugNH('navigation.manage-user.' . $sKey);

    if ($sKey == 'list') {
        $MenuManageUserLevel1->add($sTempURL, $sName)->activePattern("\/profile-.{5}\/" . CNamHoa::slugNH('system.my-profile'));
    } else if ($sKey == 'create') {

        $tempClass = CNamHoa::getHideClass('create-user', ['addClass' => 'disabled-link tooltips']);
        if ($tempClass) {
            $MenuManageUserLevel1->add('#', "<span class='disable-target' style='font-style:italic;'>$sName</span>", null, null, ['class' => $tempClass]);
        } else {
            $MenuManageUserLevel1->add($sTempURL, $sName);
        }
    } else {
        $MenuManageUserLevel1->add($sTempURL, $sName);
    }
}

$MenuAdminLevel1 = Menu::items()->addClass('sub-menu');

foreach (trans('navigation.admin') as $sKey => $sName) {
    $sTempURL = CNamHoa::slugNH('navigation.admin-name') . '/' . CNamHoa::slugNH('navigation.admin.' . $sKey);
    $MenuAdminLevel1->add($sTempURL, $sName);
}

Menu::handler('main', [
        'class'            => 'page-sidebar-menu',
        'data-auto-scroll' => 'false',
        'data-slide-speed' => '200',
        'style'            => 'margin-top: 25px',
    ])
    ->add('', '<i class="fa fa-home"></i><span class="title">' . trans('navigation.home') . '</span>', null, null, [ 'class' => 'start'])
    ->add('javascript:;', '<i class="fa fa-group"></i><span class="title">' . trans('navigation.manage-user-name') . '</span><span class="arrow"></span>', $MenuManageUserLevel1)
    ->add(CNamHoa::slugNH('navigation.classes'), '<i class="fa fa-map-marker"></i><span class="title">' . trans('navigation.classes') . '</span>')
    ->add(CNamHoa::slugNH('navigation.document'), '<i class="fa fa-book"></i><span class="title">' . trans('navigation.document') . '</span>')
    ->add('javascript:;', '<i class="fa fa-windows"></i><span class="title">' . trans('navigation.admin-name') . '</span><span class="arrow"></span>', $MenuAdminLevel1)
;

echo Menu::handler('main')->render();

unset($sTempRoute, $manage_user_level1, $monitor_level1, $admin_level1);
?>